package com.db.springcloud.service;

import com.db.springcloud.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Component
//@FeignClient(value = "SPRINGCLOUD-PROVIDER-USER",fallbackFactory = UserClientServiceFallbackFactory.class)
@FeignClient(value = "SPRINGCLOUD-PROVIDER-USER",fallback = UserClientServiceImpl.class)
public interface UserClientService {

    @RequestMapping("/user/add")
    boolean addUser(User user);

    @RequestMapping("/user/get/{id}")
    User queryById(@PathVariable("id") int id);

    @RequestMapping("/user/getall")
    List<User> queryAll();
}
